package com.assessment.util;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import org.apache.poi.hssf.usermodel.HSSFCell;
import org.apache.poi.hssf.usermodel.HSSFRow;
import org.apache.poi.hssf.usermodel.HSSFSheet;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;

public class importGrade {
	
	public static void main(String[] args) throws IOException {
		 FileInputStream inputStream = new FileInputStream(new File("d:\\poi\\测试.xls"));  
	        //读取工作簿  
	        HSSFWorkbook workBook = new HSSFWorkbook(inputStream);  
	        //读取工作表  
	        HSSFSheet sheet = workBook.getSheetAt(1);  
	        
	        //读取行  
	        HSSFRow row = sheet.getRow(2);  
	        //读取单元格  
	        HSSFCell cell = row.getCell(4);  
	        String value = cell.getStringCellValue();  
	          
	        System.out.println(value);  
	        System.out.println(sheet.getLastRowNum());
	     
	          
	        inputStream.close();  
	        workBook.close();//最后记得关闭工作簿  
	}

}
